$(function () {

    $('.input-date').datetimepicker({
        format:'yyyy-mm-dd', //格式
        language:'zh-CN', //中文
        autoclose: true,//选择后自动关闭
        //showMeridian:true, //是否显示上下午
        minView:2,//精确到哪位
    });

    $('.input-date-noss').datetimepicker({
        format:'yyyy-mm-dd hh:ii', //格式
        language:'zh-CN', //中文
        autoclose: true,//选择后自动关闭
        //showMeridian:true, //是否显示上下午
        minView:0,//精确到哪位
    });


    $('.btn-delete').click(function () {
        Swal.fire({
            title: '是否删除',
            text: "是否删除",
            icon: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!'
        }).then((result) => {
            if (result.value) {
                //点击确认按钮后做的事情
                var url = $(this).data('url');
                window.location.href = url;
            }
        });
    });
    $('.btn-error').click(function () {
        Swal.fire({
            title: '',
            text: "是否删除",
            icon: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!'
        }).then((result) => {
            if (result.value) {
                //点击确认按钮后做的事情
                var ids = [];
                $('.cb').each(function (id, ele) {
                    if ($(ele).prop('checked')) {
                        ids.push($(ele).val());
                    }
                });
                $.get("/employee/deleteInBatches", "ids=" + ids, function () {
                    window.location.href = "/employee/list";
                });

            }
        });
    });





});

